package com.smcaiot.filesync.starter.app;

import com.smcaiot.filesync.starter.handler.impl.DefaultFileHandler;
import io.minio.MinioClient;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan("com.smcaiot.filesync.starter")
@EnableConfigurationProperties({FileSyncProperties.class})
public class FileSyncAutoConfiguration {

    @Bean
    @ConditionalOnBean(MinioClient.class)
    public DefaultFileHandler defaultPicRemoteHandler(){
        return new DefaultFileHandler();
    }

}
